package product

import (
	"gitcode.com/G-YT/iHealth25/server/global"
	"gorm.io/datatypes"
)

// Product 商品结构体
type Product struct {
	global.GVA_MODEL
	Name          *string        `json:"name" form:"name" gorm:"comment:商品名称;column:name;size:100;" binding:"required"`                           //商品名称
	ProductType   uint           `json:"productType" form:"productType" gorm:"comment:商品类型;column:product_type;" binding:"required"`              //商品类型
	Thumbnail     string         `json:"thumbnail" form:"thumbnail" gorm:"comment:商品缩略图;column:thumbnail;" binding:"required"`                    //商品缩略图
	Images        datatypes.JSON `json:"images" form:"images" gorm:"comment:商品图片;column:images;" swaggertype:"array,object"`                      //商品图片
	Description   *string        `json:"description" form:"description" gorm:"comment:商品详情;column:description;type:text;"`                        //商品详情
	Specification datatypes.JSON `json:"specification" form:"specification" gorm:"comment:规格参数(实体商品);column:specification;" swaggertype:"object"` //规格参数
	Status        *bool          `json:"status" form:"status" gorm:"default:true;comment:状态;column:status;"`                                      //状态
}

// TableName 商品表 Product自定义表名 ih_products
func (Product) TableName() string {
	return "ih_products"
}
